-module('ex_5.3_block_structure_indicators').

-include_lib("eunit/include/eunit.hrl").

-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").

single_test_() ->
    ?_assertMatch(
      {yamerl_parser,
        {file,?FILENAME},
        [],
        <<>>,
        62,
        true,
        [],
        0,
        63,
        8,
        1,
        false,
        7,
        14,
        utf8,
        false,
        undefined,
        _,
        _,
        [],
        {bcoll,root,0,-1,1,1,-1,1,1},
        false,
        false,
        false,
        [{impl_key,false,false,undefined,undefined,1,1}],
        false,
        false,
        _,
        [],
        0,
        29,
        28,
        undefined,
        undefined,
        _,
        false,
        [],
        [
          {yamerl_stream_end,7,14},
          {yamerl_doc_end,7,14},
          {yamerl_collection_end,7,14,block,mapping},
          {yamerl_collection_end,7,14,block,mapping},
          {yamerl_scalar,7,9,
            {yamerl_tag,7,9,{non_specific,"?"}},
            flow,plain,"green"},
          {yamerl_mapping_value,7,7},
          {yamerl_scalar,7,3,
            {yamerl_tag,7,3,{non_specific,"?"}},
            flow,plain,"sea"},
          {yamerl_mapping_key,7,3},
          {yamerl_scalar,6,5,
            {yamerl_tag,6,5,{non_specific,"?"}},
            flow,plain,"blue"},
          {yamerl_mapping_value,6,3},
          {yamerl_scalar,5,5,
            {yamerl_tag,5,5,{non_specific,"?"}},
            flow,plain,"sky"},
          {yamerl_mapping_key,5,3},
          {yamerl_collection_start,5,3,
            {yamerl_tag,5,3,{non_specific,"?"}},
            block,mapping},
          {yamerl_mapping_value,4,8},
          {yamerl_scalar,4,1,
            {yamerl_tag,4,1,{non_specific,"?"}},
            flow,plain,"mapping"},
          {yamerl_mapping_key,4,1},
          {yamerl_collection_end,3,6,block,sequence},
          {yamerl_scalar,3,3,
            {yamerl_tag,3,3,{non_specific,"?"}},
            flow,plain,"two"},
          {yamerl_sequence_entry,3,1},
          {yamerl_scalar,2,3,
            {yamerl_tag,2,3,{non_specific,"?"}},
            flow,plain,"one"},
          {yamerl_sequence_entry,2,1},
          {yamerl_collection_start,2,1,
            {yamerl_tag,2,1,{non_specific,"?"}},
            block,sequence},
          {yamerl_mapping_value,1,9},
          {yamerl_scalar,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            flow,plain,"sequence"},
          {yamerl_mapping_key,1,1},
          {yamerl_collection_start,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            block,mapping},
          {yamerl_doc_start,1,1,{1,2},_},
          {yamerl_stream_start,1,1,utf8}
        ]
      },
      yamerl_parser:file(?FILENAME)
    ).
